package com.yaoxuguang.concurrence.wait_notify.notify;

import java.util.concurrent.TimeUnit;

/**
 * @author yaoxuguang
 * @Title: yao-interview
 * @Package com.yaoxuguang.concurrence.wait_notify.notify
 * @Description: 测试线程的等待/通知机制
 * @date 2018年12月21日17:28
 */
public class Run {
    public static void main(String[] args) {
        try {
            Object obj = new Object();
            ThreadWait wait = new ThreadWait(obj);
            wait.setName("wait_thread");
            wait.start();
            TimeUnit.SECONDS.sleep(1);
            ThreadNotify notify = new ThreadNotify(obj);
            notify.setName("notify_thread");
            notify.start();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
